/**
 * 文 件 名:  PlayerScript.java
 * 工 程 名:  ScriptManager
 * 创建日期:  2015年4月8日 上午10:31:48
 * 创建作者:  杨 强  <281455776@qq.com>
 */
package test.impl;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import annotation.RequireCopy;
import script.impl.BaseScript;

/**
 * @author 杨 强
 *
 */
public class PlayerScript extends BaseScript {
    /**
     * 测试数据该字段需要拷贝老脚本的testData
     */
    @RequireCopy("testData")
    private static Map<String, String> testData = new HashMap<String, String>();
    private static final PlayerScript script = new PlayerScript();

    public PlayerScript() {
        for (int i = 1; i < 10; i++) {
            testData.put(String.valueOf(i), String.valueOf(i));
        }
    }

    public static PlayerScript getScript() {
        return script;
    }

    public void show() {
        System.out.println("玩家555show");
        Iterator<Map.Entry<String, String>> it = testData.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<String, String> entry = it.next();
            System.err.println(entry.getKey() + "----------->" + entry.getValue());
        }
    }

    public static Map<String, String> getTestData() {
        return testData;
    }

    public static void setTestData(Map<String, String> testData) {
        PlayerScript.testData = testData;
    }
}
